import request from '@/utils/request'

// 巡查任务分页列表
export function getSurveyTaskList(params) {
  return request({
    url: '/safe/SurveyTaskLedgerList',
    method: 'get',
    params: params
  })
}

// 新增巡查任务
export function addSurveyTask(data) {
  return request({
    url: '/safe/addSurveyTask',
    method: 'post',
    data: data
  })
}

// 修改巡查任务
export function updateSurveyTask(data) {
  return request({
    url: '/safe/updateSurveyTask',
    method: 'post',
    data: data
  })
}

// 获取巡查任务详情
export function getSurveyTaskDetail(id) {
  return request({
    url: `/taskCheck/surveyTaskChecksByTaskId`,
    method: 'get',
    params:{taskId:id}
  })
}

// 删除巡查任务
export function deleteSurveyTask(id) {
  return request({
    url: `/safe/deleteSurveyTask/${id}`,
    method: 'post'
  })
}

// 获取巡查任务年度列表
export function getSurveyTaskYearList() {
  return request({
    url: '/safe/surveyTaskYearList',
    method: 'get'
  })
}
// 根据任务巡查表id获取巡查表内容
export function surveyTaskChecksByTaskId(id) {
	console.log(id)
  return request({
    url: `/taskCheck/surveyTaskChecksByTaskId`,
    method: 'get',
    params:{taskId:id}
  })
}
// 勘察-巡查任务列表问题提交
export function updateSurveyTaskLedgerCheck(data) {
  return request({
    url: '/taskCheck/updateSurveyTaskLedgerCheck',
    method: 'post',
    data: data
  })
}
// 删除巡查任务
export function deleteSurveyTaskLedgerById(id) {
  return request({
    url: `/safe/deleteSurveyTaskLedgerById/${id}`,
    method: 'post'
  })
}
// 勘察- 巡查任务反馈的附件查询
export function taskCheckAttachByTaskLedgerId(id) {
  return request({
    url: `/taskCheck/taskCheckAttachByTaskLedgerId/${id}`,
    method: 'post'
  })
}